package demo7;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:张熳
 * Date:2025-09-01
 * Time:14:32
 */
//接口使用实例
//Clonable接口和深拷贝

public class Test {
    public static void main(String[] args) throws CloneNotSupportedException{
        Person person1 = new Person("zhangsan",10);
        Person person2 = (Person) person1.clone();

        System.out.println("修改前："+ person1.m.money);
        System.out.println("修改前："+ person2.m.money);

        person2.m.money = 9.9;

        System.out.println("修改后："+ person1.m.money);
        System.out.println("修改后："+ person2.m.money);
    }
}
